1. Field of the Invention
The present invention is related to ordering of physical extents.
2. Description of the Related Art
Storage Area Networks (SANs) may be used for server-free backup. With server-free backup, when data is to be backed up (e.g., from a client computer to a server computer), the actual data transfer is performed by a data mover device (i.e., hardware) in the Storage Area Network, which could be, for example, a FibreChannel/SCSI gateway. The data mover receives instructions about which data to copy through physical Small Computer System Interface (SCSI) addresses, consisting of pairs of SCSI offsets and lengths. The SCSI offsets are expressed as logical block addresses (LBAs), but are “physical” from the perspective of a client computer.
In contrast, logical offsets are used, for example, by file systems, and start at offset zero for a given logical volume. The logical offsets are mapped at the client computer to the corresponding “physical” addresses, expressed in logical block addresses, which start at offset zero for a given physical disk, which may contain many logical volumes. While the logical blocks used by a given logical volume are always consecutive, their physical mapping may not be. For example, a spanned volume is one that consists of several physical parts (called “extents” herein) on potentially multiple physical disks that are not contiguous. In the case of a spanned volume, a single consecutive logical extent comprising multiple logical blocks may map to multiple non-contiguous physical extents. Logical extents and physical extents are blocks of data in logical and physical volumes, respectively.
This creates a problem for server-free backup because the physical extents copied by the data mover should be copied in logical order, so that the backed up image can be restored to volumes having a different physical layout. For example, a logical volume with extent offset 0 and length 100 may map to a first physical extent (i.e., extent 1) and a second physical extent (i.e., extent 2), with the first physical extent having an offset of 300 and a length of 40 and the second physical extent having an offset of 200 and a length of 60.
A backup application at the client computer needs to ensure that the physical extents are backed up in logical order, in this case, the first physical extent and then the second physical extent, even if the backup application does not receive physical extents for a given logical volume in this order (e.g., from an Application Programming Interface (API) of the operating system). If the physical extents are backed up in logical order, the backed up data can be restored to a physical volume with, for example, the following physical layout: physical extent 1 with offset 10 and length 10; physical extent 2 with offset 100 and length 80; and, physical extent 3 with offset 40 and length 10.
Thus, there is a need for a technique for determining the correct logical order of the physical extents.